<?php require VIEW_ROOT.'/common/header.php'?>

<style>.lastId td {background:#ffffC4;}</style>

<div class="info">
	<a href="?m=finance&a=assets_form">添加资产</a>
  当前总计 <b><?php echo library_common::money_num($lastSum); ?></b> 。
</div>

<table>
	<tr>
		<th width="160">时间</th>
		<th width="150">名称</th>
		<th width="80">总额</th>
		<th>备注</th>
		<th width="80">操作</th>
	</tr>
	<?php foreach ($resLast as $row) {?>
	<tr>
          <td><?php echo date('Y年n月j日', $row['createtime'])?> <i style="color:#666;font-size:10px;"><?php echo date('H:i:s', $row['createtime'])?></i></td>
		<td><?php echo $row['name']; ?></td>
		<td><b><?php echo library_common::money_num($row['amount']); ?></b></td>
		<td class="frm"><?php echo nl2br($row['note']); ?></td>
		<td>
			<a href="?m=finance&a=assets_form&id=<?php echo $row['id']?>">编辑</a>
			<a href="?m=finance&a=assets_delete&id=<?php echo $row['id']?>" onclick="return confirm('确认要删除?')">删除</a>
		</td>
	</tr>
	<?php } // end foreach?>
</table>

<table>
	<tr>
		<th width="160">时间</th>
		<th width="150">名称</th>
		<th width="80">总额</th>
		<th>备注</th>
		<th width="80">操作</th>
	</tr>
	<?php foreach ($res as $row) {?>
  	<?php echo isset($lastIds[$row['id']]) ? '<tr class="lastId">' : '<tr>'; ?>
          <td><?php echo date('Y年n月j日', $row['createtime'])?> <i style="color:#666;font-size:10px;"><?php echo date('H:i:s', $row['createtime'])?></i></td>
		<td><?php echo $row['name']; ?></td>
		<td><b><?php echo library_common::money_num($row['amount']); ?></b></td>
		<td class="frm"><?php echo nl2br($row['note']); ?></td>
		<td>
			<a href="?m=finance&a=assets_form&id=<?php echo $row['id']?>">编辑</a>
			<a href="?m=finance&a=assets_delete&id=<?php echo $row['id']?>" onclick="return confirm('确认要删除?')">删除</a>
		</td>
	</tr>
	<?php } // end foreach?>
</table>

<?php require VIEW_ROOT.'/common/footer.php'?>
